/***************************************************
 * utk filesystem
 * Author: sanghyeb lee slee91@utk.edu
 */

#ifndef INODE_H
#define INODE_H

/*declaration of the utk inode as the disk*/
typedef struct utk_inode {
  u32 nlinks; //numbe of linkes
  u32 size;  //file size
  mtime_t mtime; //when was last changed
  mtime_t atime; //when was last accessed
  mtime_t ctime; //when created
  zone_t zone[MAX_TOTAL_ZONES]; //zone
  u32 pad;
} utk_inode; 


/* inode-table.
   this table holds inodes that are currently used by a process*/
struct inode {
  /* same as disk inode*/
  u32 nlinks; //numbe of linkes
  u32 size;  //file size

  mtime_t mtime; //when was last changed
  mtime_t atime; //when was last accessed
  mtime_t ctime; //when created
  zone_t zone[MAX_TOTAL_ZONES]; //zone
  u32 pad;
  /* only in memory inode*/
  int count; /*how many used*/
  char dirty;
  char seek;
  char update;
  
} inode_table[MAX_INODES];

#define SIZE_INODE sizeof(struct utk_inode) /*size of disk inode*/
#define MAX_INDIRECT_BLOCK (BLOCK_SIZE/ZONE_ADDRESS_SIZE) /*zones /block*/
#define MAX_INODE_BLOCK (BLOCK_SIZE/SIZE_INODE) /*#inodes/blocks */


  
#endif
